import collections

Q = collections.deque()

for i in range(10):
    Q.append(i)
while Q:
    print(Q[0])
    #Q.pop()
    Q.popleft()